/**
 * Copyright (c) 2020 qar All rights reserved.
 * <p>
 * https://www.qar.io
 * <p>
 * 版权所有，侵权必究！
 */

package com.example.service.impl;

import com.example.dto.GenTableFieldDTO;
import com.example.dto.GenTableInfoDTO;
import com.example.mybatis.service.impl.BaseServiceImpl;
import com.example.dao.TableFieldDao;
import com.example.entity.TableFieldEntity;
import com.example.service.TableFieldService;
import com.example.utils.ConvertUtils;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 表
 *
 * @author Mark sunlightcs@gmail.com
 */
@Service
public class TableFieldServiceImpl extends BaseServiceImpl<TableFieldDao, TableFieldEntity> implements TableFieldService {

    @Override
    public List<GenTableFieldDTO> getByTableName(String tableName) {
        return ConvertUtils.sourceToTarget(baseDao.getByTableName(tableName), GenTableFieldDTO.class);
    }

    @Override
    public void deleteByTableName(String tableName) {
        baseDao.deleteByTableName(tableName);
    }

    @Override
    public void deleteBatchTableIds(Long[] tableIds) {
        baseDao.deleteBatchTableIds(tableIds);
    }

}